package com.niiwoo.civet.trade.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 授信额度类型
 * @author: liaozuliang
 * @date: 2018/4/25
 */
@Getter
@AllArgsConstructor
public enum ProjectCreditTypeEnum {

    UNKNOWN((byte) 0, "未知", "",LoanTypeEnum.OTHER_LOAN),
    SOCIAL_SECURITY((byte) 1, "社保", "社保授信",LoanTypeEnum.SOCIAL_SECURITY_LOAN),
    ZHIMA((byte) 2, "芝麻", "",LoanTypeEnum.OTHER_LOAN),
    EDUCATION((byte) 3, "学历", "",LoanTypeEnum.OTHER_LOAN),
    RONG360((byte) 4, "融360", "",LoanTypeEnum.SPEED_LOAN),
    NIIWOO((byte) 5, "自有资质", "资质授信",LoanTypeEnum.OTHER_LOAN),
    NIIWOO_RONG360((byte) 6, "融360自有资质", "资质授信",LoanTypeEnum.SPEED_LOAN),
    CREDIT_CARD((byte) 7, "信用卡", "信用卡授信",LoanTypeEnum.CREDIT_CARD_LOAN),
    HOUSE_PROPRIETARY_CERTIFICATE((byte) 8, "房产证", "房产证授信",LoanTypeEnum.HOUSE_MORTGAGE_LOAN),
    DECORATION((byte) 9, "装修项目", "装修项目授信",null),
    CAR((byte) 10, "车辆", "车辆授信",null),
    SIMPLE_CREDIT((byte) 11, "信用授信", "信用",null),
	CONSUME((byte) 12, "消费", "淘宝授信", LoanTypeEnum.CONSUME_LOAN),
    BUSINESS((byte) 13, "生意贷", "生意贷", LoanTypeEnum.BUSINESS_LOAN);

    private Byte type;
    private String desc;
    private String tag;
    private LoanTypeEnum loanTypeEnum;

    public static ProjectCreditTypeEnum typeOf(Byte type) {
        for (ProjectCreditTypeEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return ProjectCreditTypeEnum.UNKNOWN;
    }
}
